package com.jcourse.bookstore;
import java.util.Scanner;
public class ArrayCourse {

	public static void main(String[] args) {
		
		int xa[] =  {12,5,3,4,9};//声明
		xa = sort(xa);
		
		int score[]=new int[10];
		Scanner scan=new Scanner(System.in);
		for(int i=0;i<10;i++) {
			System.out.println("请输入第"+i + "门成绩：");
			int s = scan.nextInt();
			score[i]=s;
		}
		int aver=average(score);
		for(int i=0; i< score.length;i++) {
			if(score[i]>aver);
		}
		System.out.println(score);
	}
	
	
	static int average(int[] s) {
		int sum = 0;
		for(int i = 0;i< s.length;i++) {
			sum += s[i];
			
		}
		return sum/s.length;
	}
	//排序
	static int[] sort(int[] data) {
		for(int i=0; i<=data.length - 2; i++) {
			for(int j = i+1; j<data.length; j++) {
				if(data[i]>data[j]) {
					int temp = data[i];
					data[i] = data[j];
					data[j] = temp;				
				}
			}
		}
		return data;
	}
	
}
